# Contributor: Bart Ribbers <bribbers@disroot.org>
# Maintainer: team/kde <bribbers@disroot.org>

# The group tag is just to easily find this APKBUILD by some scripts for automation
# group=kde-plasma
pkgname=plasma5support
pkgver=6.0.4
pkgrel=0
pkgdesc="Support components for porting from KF5/Qt5 to KF6/Qt6"
# armhf blocked by extra-cmake-modules
arch="all !armhf"
url="https://kde.org/plasma-desktop/"
license="GPL-2.0-or-later"
makedepends="
	extra-cmake-modules
	doxygen
	kconfig-dev
	kcoreaddons-dev
	ki18n-dev
	kio-dev
	kpackage-dev
	kservice-dev
	kxmlgui-dev
	qt6-qtbase-dev
	qt6-qtdeclarative-dev
	qt6-qttools-dev
	samurai
	"

case "$pkgver" in
	*.90*) _rel=unstable;;
	*) _rel=stable;;
esac
subpackages="$pkgname-dev $pkgname-doc $pkgname-lang"
_repo_url="https://invent.kde.org/plasma/plasma5support.git"
source="https://download.kde.org/stable/plasma/$pkgver/plasma5support-$pkgver.tar.xz"

build() {
	cmake -B build -G Ninja \
		-DCMAKE_BUILD_TYPE=RelWithDebInfo \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib \
		-DBUILD_TESTING=ON \
		-DBUILD_QCH=ON
	cmake --build build
}

check() {
	ctest --test-dir build --output-on-failure
}

package() {
	DESTDIR="$pkgdir" cmake --install build
}
sha512sums="
db501ad90331871a46450a3e051830970d4da2e0a90f7ee4b8d97efca7f1b2e9995418bc124b1378fa3af94dcfcdb9c46f376eb44d27c54036b2e22469867763  plasma5support-6.0.4.tar.xz
"
